package com.example.kafkastream;

import org.apache.kafka.streams.kstream.KStream;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

import java.util.function.Consumer;

@SpringBootApplication
public class KafkaStreamApplication {

	public static void main(String[] args) {
		SpringApplication.run(KafkaStreamApplication.class, args);
	}

	@Bean("hello")
	public Consumer<KStream<Object, String>> hello() {
		return input ->
				input
						.foreach((k, v) -> System.out.println("Received greetings: " + v));
	}

}
